<template>
  <div class="swipe">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item  v-for="item in banners" :key="item.id">
        <img class="imgs" :src="item.img_url" alt="" @load='imageLoad'>
      </van-swipe-item>
    </van-swipe>
  </div>
</template>
<script>
export default {
  props:{
    banners:Array,
    default(){
      return []
    }
  },
  methods: {
    //监听轮播图加载完毕
    imageLoad(){
      this.$emit('swiperImageLoad')
    }
  },
}
</script>
<style scoped>
  .my-swipe .van-swipe-item {
    color: #fff;
    font-size: 20px;
    text-align: center;
  }
.imgs {
    width:100%;
    height:100% !important;
}
</style>
